/*
 * Main front page
 * @author: Ammar ahmed
 * 
 * This is the main 1st page that launches. it's porpus is to boot up and display the menue to the other options.
 */

package com.uncc.sensingsuite;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class sensingsuite extends Activity 
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) 
    {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.main);
        Button b1=(Button)findViewById(R.id.busList);
        Button b2=(Button)findViewById(R.id.busMap);  
        Button b3=(Button)findViewById(R.id.About);  
        Button b4=(Button)findViewById(R.id.userInfo);  
        
        //
        final CharSequence[] items = {"Red", "Green", "Blue"};

        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle("Pick a color");
        
        //open up the dialog to chose a bus color
        builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialog, int item) {
                Toast.makeText(getApplicationContext(), items[item], Toast.LENGTH_SHORT).show();
            }
        });
        
        //Show the list of the buses
        b1.setOnClickListener(new View.OnClickListener() 
        {
        	public void onClick(View v)
        	{
        		Toast.makeText(getBaseContext(), "loading list of buses", Toast.LENGTH_LONG).show();
        		Intent myintent1 = new Intent(sensingsuite.this, mainlist.class);
        		startActivity(myintent1);
        		//AlertDialog alert = builder.create();
        		
        	}
        });
        
        //Show the map
        b2.setOnClickListener(new View.OnClickListener() 
        {
        	public void onClick(View v)
        	{
        		Toast.makeText(getBaseContext(), "loading list of buses", Toast.LENGTH_LONG).show();
        		Intent myintent2 = new Intent(sensingsuite.this, mainmap.class);
        		startActivity(myintent2);
        	}
        });
        
        //About the User
        b3.setOnClickListener(new View.OnClickListener() 
        {
        	public void onClick(View v)
        	{
        		Toast.makeText(getBaseContext(), "loading list of buses", Toast.LENGTH_LONG).show();
        		Intent myintent3 = new Intent(sensingsuite.this, mainuserinfo.class);
        		startActivity(myintent3);
        	}
        });
        
        //About the application
        b4.setOnClickListener(new View.OnClickListener() 
        {
        	public void onClick(View v)
        	{
        		Toast.makeText(getBaseContext(), "loading list of buses", Toast.LENGTH_LONG).show();
        		Intent myintent4 = new Intent(sensingsuite.this, aboutmain.class);
        		startActivity(myintent4);
        	}
        });
        


        
    }
    
}